Ext.define('TS.lib.plugins.CheckboxColumn',{
	extend:'Ext.grid.column.Column',
	onFlag: true,offFlag: false,
	align:'center',
	style:'text-align:center',
	alias:'widget.checkboxcolumn',
	editor:{
		xtype:'checkbox',
		listeners:{
			focus:function(){
				this.setValue(!this.getValue());
				Ext.getDom('sweet_login').focus();// TODO jak defocusować
			}
		}
	},
	initComponent: function(cfg){
		this.initConfig(cfg);
		var on=this.onFlag;
		this.renderer = function(value, metaData, record, rowIndex, colIndex, store,view){
			var tpl = '<div class="ts-row-checker {0}"></div>';
			var state = value == on ? 'ts-row-checked' : '';
			return Ext.String.format(tpl,state);
		};
		this.callParent(arguments);
	}										
});